home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / batutl2.zip / FAKEY.DOC < prev    next >
Text File  |  1986-06-25  |  12KB  |  271 lines

  1.                                    FAKEY
  2.  
  3.                           Keyboard Phantom Typist
  4.  
  5.                                 Version 1.0
  6.  
  7.  
  8.  
  9. (C) COPYRIGHT 1986 by System Enhancement Associates; ALL RIGHTS RESERVED
  10.  
  11.  
  12.  
  13. FAKEY is used to fake sequences of keystrokes.  It is especially useful in
  14. batch files, where it can be used to "pre-load" input for programs.  It is
  15. faking it at the point where BIOS is called.  It will not affect programs
  16. that bypass BIOS for their input.  FAKEY can fake keyboard input for almost
  17. any program, except for certain resident utilities.
  18.  
  19.  
  20. FAKEY takes one or more arguments, separated by spaces.  Each argument can
  21. be any one of the following:
  22.  
  23. 1)  A text literal enclosed in quotes.  See below.
  24.  
  25. 2)  A decimal number, indicating the ASCII value of a character.
  26.  
  27. 3)  A hexadecimal number of up to four digits, preceeded by an ampersand.
  28.  
  29. 4)  A mnemonic value indicating a particular keystroke.
  30.  
  31. None of these are case sensitive, except literal text in quotes.  Hex
  32. digits, mnemonics, and so forth can be entered in any combination of upper
  33. and lower case.
  34.  
  35. If an argument indicates a character value, then the character value is
  36. filled out to include a scan code value.  Where more than one scan code is
  37. possible (such as Backspace or Ctrl H), the more "conventional" choice is
  38. made (ie. Backspace instead of Ctrl H, top row instead of number pad, etc.)
  39.  
  40. A text literal is enclosed in quotes, and may contain special sequences.
  41. The special sequences currently defined are:
  42.  
  43. 1)  An uparrow followed by a character from A to Z (in this case really "at
  44.     sign" to "underline"), indicating the equivalent control key.
  45.  
  46. 2)  An exclamation mark followed by a digit or a character from A to Z,
  47.     indicating the equivalent alter key.
  48.  
  49. 3)  A backslash followed by another character.  Defined uses are:
  50.  
  51.     a)   \r   for a return or enter
  52.     b)   \t   for a tab
  53.     c)   \b   for a backspace
  54.     d)   \e   for an escape
  55.     e)   \anything else, for a literal character.  Thus \" is a quote, \\
  56.          is a backslash, \! is an exclamation mark, etc.
  57.  
  58.  
  59. A mnemonic can be an uparrow, exclamation mark, or backslash followed by a
  60. character, in which case it means the same thing as in a text literal.  The
  61. following additional mnemonics are also defined:
  62.  
  63.     Standard ASCII mnemonics:
  64.  
  65.          NUL SOH STX ETX EOT ENQ ACK BEL
  66.          BS  HT  LF  VT  FF  CR  SO  SI
  67.          DLE DC1 DC2 DC3 DC4 NAK SYN ETB
  68.          CAN EM  SUB ESC FS  GS  RS  US
  69.          SP  DEL
  70.  
  71.     Cursor movement keypad mnemonics:
  72.  
  73.          UP DOWN LEFT RITE HOME END PGUP PGDN
  74.  
  75.     Function key mnemonics:
  76.  
  77.          Fn   for normal
  78.          Sn   for shifted
  79.          Cn   for control
  80.          An   for alter
  81.  
  82.               Where "n" is a number from 1 to 10.  Ie. A10 means Alt F10.
  83.  
  84.     Special mnemonics:
  85.  
  86.          TOSS      Causes all previous pending keystrokes to be thrown
  87.                    away.  Does not affect the sequence being defined.
  88.  
  89.          WAIT <n>  Causes a pause for <n> seconds in the input stream.
  90.                    Keystrokes will not appear to be available for the
  91.                    duration of the wait.  The maximum wait is 255 seconds.
  92.  
  93.          BOOT      Causes a warm system boot, as if the user had typed
  94.                    "Ctrl-Alt-Del".
  95.  
  96.  
  97. Notes on special mnemonics:
  98.  
  99.     The TOSS mnemonic takes effect at the point where FAKEY is run.  It
  100.     serves to discard faked keystrokes which an earlier program didn't use.
  101.  
  102.     The other special mnemonics take effect at the point where they are
  103.     first scanned by the operating system.  This is not always when you
  104.     might think.  DOS (along with many applications programs) scans the
  105.     keyboard buffer to see if anything is pending at many points, so things
  106.     may take effect sooner than you would expect.  For example, if your
  107.     batch file contained:
  108.  
  109.          fakey ^C
  110.          myprog
  111.  
  112.     then "myprog" would not be run.  DOS would check the keyboard after
  113.     running FAKEY and before running the next program, and see the pending
  114.     control C.  Your batch file would stop while DOS asks:
  115.  
  116.          Terminate batch file (y/n)?
  117.  
  118.     You probably don't want that.  So instead, you should say:
  119.  
  120.          fakey wait 1 ^C
  121.          myprog
  122.  
  123.     This would cause a one second delay before the control C shows up in
  124.     the keyboard buffer.
  125.  
  126.     If this doesn't make sense, then don't worry too much.  This is all
  127.     meant to address a few special cases which don't normally arise.
  128.  
  129.  
  130. Example:
  131.  
  132.     Here's an example of a batch file to delete all of the files in a
  133.     directory, without waiting for DOS to ask for confirmation:
  134.  
  135.          fakey "y\r"
  136.          del %1
  137.          fakey toss
  138.  
  139.     Assuming you named the file ZAPDIR.BAT, then typing ZAPDIR X would give
  140.     the DOS command "del X".  When DOS stops to ask "Are you sure?", it
  141.     will think you pressed "y", and continue.
  142.  
  143.     In this example we ended the file with "fakey toss".  This is so that
  144.     if DOS doesn't ask for confirmation (maybe X is a file instead of a
  145.     directory), the "y" won't be left hanging around.
  146.  
  147.  
  148.  
  149. Hexadecimal literals:
  150.  
  151.     These can be used to fake any keystroke whatsoever.  Use the table
  152.     following to pick out the keystroke you want.  For example, a shifted
  153.     keypad 5 would be:
  154.  
  155.          fakey &4C35
  156.  
  157.     A table entry of "--" means you can't get that combination out of BIOS.
  158.  
  159.  
  160.  
  161.     BIOS keystroke codes, hexadecimal
  162.  
  163.     Key      Normal         Shift          Control        Alter
  164.  
  165.     Esc      011B           011B           011B            --
  166.     1!       0231 '1'       0221 '!'        --            7800
  167.     2@       0332 '2'       0340 '@'       0300           7900
  168.     3#       0433 '3'       0423 '#'        --            7A00
  169.     4$       0534 '4'       0524 '$'        --            7B00
  170.     5%       0635 '5'       0625 '%'        --            7C00
  171.     6^       0736 '6'       075E '^'       071E           7D00
  172.     7&       0837 '7'       0826 '&'        --            7E00
  173.     8*       0938 '8'       092A '*'        --            7F00
  174.     9(       0A39 '9'       0A28 '('        --            8000
  175.     0)       0B30 '0'       0B29 ')'        --            8100
  176.     -_       0C2D '-'       0C5F '_'       0C1F           8200
  177.     =+       0D3D '='       0D2B '+'        --            8300
  178.     BkSpc    0E08           0E08           0E7F            --
  179.     tab      0F09           0F00            --             --
  180.     q        1071 'q'       1051 'Q'       1011           1000
  181.     w        1177 'w'       1157 'W'       1117           1100
  182.     e        1265 'e'       1245 'E'       1205           1200
  183.     r        1372 'r'       1352 'R'       1312           1300
  184.     t        1474 't'       1454 'T'       1414           1400
  185.     y        1579 'y'       1559 'Y'       1519           1500
  186.     u        1675 'u'       1655 'U'       1615           1600
  187.     i        1769 'i'       1749 'I'       1709           1700
  188.     o        186F 'o'       184F 'O'       180F           1800
  189.     p        1970 'p'       1950 'P'       1910           1900
  190.     [{       1A5B '['       1A7B '{'       1A1B            --
  191.     ]}       1B5D ']'       1B7D '}'       1B1D            --
  192.     enter    1C0D           1C0D           1C0A            --
  193.     Ctrl      --             --             --             --
  194.     a        1E61 'a'       1E41 'A'       1E01           1E00
  195.     s        1F73 's'       1F53 'S'       1F13           1F00
  196.     d        2064 'd'       2044 'D'       2004           2000
  197.     f        2166 'f'       2146 'F'       2106           2100
  198.     g        2267 'g'       2247 'G'       2207           2200
  199.     h        2368 'h'       2348 'H'       2308           2300
  200.     j        246A 'j'       244A 'J'       240A           2400
  201.     k        256B 'k'       254B 'K'       250B           2500
  202.     l        266C 'l'       264C 'L'       260C           2600
  203.     ;:       273B ';'       273A ':'        --             --
  204.     '"       2827 '''       2822 '"'        --             --
  205.     `~